package com.gmadmin.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * @author zhangliang
 * @version 1.0
 * @date 2022/8/2 21:08
 */
public enum MessageLevelEnum {
    //'消息级别 1 primary 一般 / 2 success 成功 / 3 warning 警告  / 4 danger 紧急危险 / 0 info 默认'
    INFO(0, "info"),
    PRIMARY(1, "primary"),
    SUCCESS(2, "success"),
    WARNING(3, "warning"),
    DANGER(4, "danger");

    MessageLevelEnum(int level, String description) {
        this.level = level;
        this.description = description;
    }

    @EnumValue  //标记数据库存的值是code
    private final int level;

    @JsonValue    //标记响应json值
    private final String description;

    public int getLevel() {
        return level;
    }

    public String getDescription() {
        return description;
    }

}
